home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / admin / xinetd.2 / xinetd / xinetd.2.1.7-linux.4 / libs / src / sio / Makefile < prev    next >
Encoding:
Makefile  |  1993-07-25  |  4.1 KB  |  152 lines

  1. # (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  2. # All rights reserved.  The file named COPYRIGHT specifies the terms 
  3. # and conditions for redistribution.
  4.  
  5. #
  6. # $Id: Makefile,v 8.6 1993/03/30 21:34:09 panos Exp $
  7. #
  8. # Based on Library makefile template: *Revision: 1.15 *
  9. #
  10.  
  11. # Available entries:
  12. #         lib             --> creates the library
  13. #        install        --> installs the library (archive, man page(s), header(s))
  14. #        uninstall    --> uninstall the library
  15. #        clean            --> removes all .o and .a files
  16. #        spotless        --> clean + uninstall
  17. #         lint            --> lints a file (usage: make lint MODULE=foo.c)
  18. #        tags            --> creates a tags file (from the SOURCES and HEADERS)
  19. #        checkout     --> checkout all files
  20. #        dist            --> distribution support
  21. #
  22.  
  23. NAME                = sio
  24. VERSION            = 1.6.2
  25.  
  26. HEADERS            = sio.h impl.h events.h sioconf.h
  27. SOURCES            = sprint.c sio.c siosup.c
  28. OBJECTS            = sprint.o sio.o siosup.o
  29.  
  30. MANFILES            = sio.3 Sprint.3
  31. INCLUDEFILES    = sio.h
  32.  
  33. # The following variables are used by the 'install' entry and
  34. # should be customized:
  35. #     LIBDIR:     where the library will be placed
  36. #     INCUDEDIR:  where the include files will be placed
  37. #     MANDIR:     where the man pages will be placed
  38. #
  39. LIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  40. MANDIR            = $(HOME)/.links/includes
  41. INCLUDEDIR        = $(HOME)/.links/manpages/man3
  42.  
  43. #
  44. # Available flags:
  45. #  -DDEBUG           :  enables assertions in the code. A failed assertion
  46. #                       terminates the program
  47. #  -DEVENTS          :  enables code that records events (currently limited
  48. #                       to which functions have been called on a given fd)
  49. #                       and code that accesses the event buffers.
  50. #  -DLITTLE_ENDIAN   :  says that the machine is a little endian. This is
  51. #                       needed if you enable EVENTS and your machine is a
  52. #                       little endian (big endian is the default).
  53. #
  54.  
  55. #
  56. # DEFS should be set from the command line; the current group of defs
  57. # is for SunOS 4.x
  58. #
  59. DEFS                = -DHAS_MMAP -DHAS_ONEXIT -DHAS_MEMOPS -DHAS_ISATTY
  60.  
  61. DEBUG                = -g            # -g or -O
  62. VERSION_DEF        = -DVERSION=\"SIO\ Version\ $(VERSION)\"
  63.  
  64. CPP_DEFS            = $(VERSION_DEF) $(DEFS)
  65.  
  66. #
  67. # The following variables shouldn't need to be changed
  68. #
  69. LINT_FLAGS        = -hbux
  70. CPP_FLAGS        = $(CPP_DEFS)
  71. CC_FLAGS            = $(DEBUG)
  72. CFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  73.  
  74. INSTALL            = install -c
  75. FMODE                = -m 640            # used by install
  76. RANLIB            = ranlib
  77.  
  78. PAGER                = less
  79.  
  80.  
  81. LIBNAME            = lib$(NAME).a
  82.  
  83. lib: $(LIBNAME)
  84.  
  85. libopt: clean
  86.     make DEBUG=-O lib
  87.     $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
  88.  
  89. $(LIBNAME): $(OBJECTS)
  90.     ar r $@ $?
  91.     $(RANLIB) $@
  92.  
  93. lint:
  94.     lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | $(PAGER)
  95.  
  96. install: $(LIBNAME)
  97.     @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  98.     then \
  99.         $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  100.         echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  101.         for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  102.         echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  103.         for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  104.         echo Installed $(MANFILES) to $(MANDIR) ;\
  105.     else \
  106.         echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  107.     fi
  108.  
  109. uninstall:
  110.     a=`pwd` ; cd $(INCLUDEDIR) ;\
  111.     if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  112.     a=`pwd` ; cd $(LIBDIR) ;\
  113.     if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  114.     a=`pwd` ; cd $(MANDIR) ;\
  115.     if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  116.  
  117. clean:
  118.     rm -f $(OBJECTS) $(LIBNAME) core
  119.  
  120. spotless: clean uninstall
  121.  
  122. tags: $(SOURCES) $(HEADERS)
  123.     ctags -w $(SOURCES) $(HEADERS)
  124.  
  125. checkout:
  126.     co $(SOURCES) $(HEADERS) $(MANFILES)
  127.  
  128. #
  129. # Distribution section
  130. # This section contains the 2 targets for distribution support: dist, dirs
  131. # "dist" checks out all files to be distributed
  132. # "dirs" prints a list of directories to be included in the distribution.
  133. # These directories should have a Makefile with a "dist" target
  134. #
  135. DISTRIBUTION_FILES    = $(HEADERS) $(SOURCES) $(MANFILES) README COPYRIGHT
  136. DIRS                        = suite
  137.  
  138. dist:
  139.     -co -q $(DISTRIBUTION_FILES)
  140.  
  141. dirs:
  142.     @echo $(DIRS)
  143.  
  144. #
  145. # PUT HERE THE RULES TO MAKE THE OBJECT FILES
  146. #
  147. sprint.o:   sio.h impl.h sioconf.h
  148. sio.o:      sio.h impl.h sioconf.h events.h
  149. siosup.o:   sio.h impl.h sioconf.h events.h
  150.  
  151.